<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<base href="<%=basePath%>">
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<meta http-equiv="expires" content="0">
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="This is my page">
<title>中国刊网-订阅</title>

<link href="css/category.css" rel="stylesheet" type="text/css" />
<link href="css/index.css" rel="stylesheet" type="text/css" />
<link href="css/common_min-1.8.css" rel="stylesheet" type="text/css">

<script type="text/javascript" src="js/jquery-1.9.0.js"></script>

</head>
<script>
	$(function() {
		var states = $(".state");
		var statesValues = $(".stateValue");
		var ids = $(".id");
		for ( var i = 0; i < states.length; i++) {
			var state = states.get(i).value;
			var id = ids.get(i).value;
			if (state == 0) {
				var str = "<a  href='subscribeB/addSubscribe?periodical.periodicalId=" + id + "'>订阅</a>";
				statesValues.get(i).innerHTML = str;
			} else {
				statesValues.get(i).innerHTML = "已订阅";
			}
		}
	});
</script>
<body onload="getState()">
<jsp:include page="top.jsp"></jsp:include>
<div class="all">
	<div class="ziye-daohang"><b>所在位置：</b><a href="index.jsp">首页</a>&nbsp;&gt;&nbsp;订阅</div>
	<div class="center">
		<div class="center-left">
			<!-- <div class="center-left-a">
				<span class="title">期刊分类导航</span>
				<a href="subscribeB/findAllJudge?categoryId=3"><b>新闻综合</b><br />Comprehensive&nbsp;news</a>
				<hr color="#D7D7D7" width="100%" />
			</div> -->
			<div class="center-left-a">
				<div class="center-left-a1"><span class="title1">期刊分类导航</span></div>
				<div class="center-left-a2">
					<ul>
					<!-- 期刊分类导航开始front/periodicalfindByCategory?id=${c.categoryId } -->
					<c:forEach var="c" items="${requestScope.categorys}" >
						<li><a href="subscribeB/findAllJudge?categoryId=${c.categoryId}"><b>${c.name}</b><br />${c.enName }</a></li>
					</c:forEach>
					<!-- 期刊分类导航结束 -->
					</ul>
				</div>
			</div>
		</div>
		<div class="center-right">
			<div class="center-right-a">
				<div class="center-right-a1"><span class="title1">期刊展示</span></div>
				
				<div class="col_left_top">
						<div class="col_left_top_menu">
							<!-- <div class="col_left_top_ads">
								<div class="col_left_top_image">
								<a href="#"><img src="../images/menu_03.gif"></a>
								</div>---图片--
								<div class="col_left_top_name">
									<a href="#">现代家电</a><span>已订阅</span>
								</div>--------期刊名--
							</div> -->
							<!--  -->
							<c:forEach var="usj" items="${requestScope.pages.records}">
							<div class="col_left_top_ads">
								<div >
								<a href="subscribeB/findNewPerPeriodical?periodical.periodicalId=${usj.periodicalId }"><img src="<%=basePath %>${usj.cover }" width="100px" height="140px"></a>
								</div><!-----图片---->
								<div >
									<%-- <a href="subscribeB/findByperiodicalId?periodical.periodicalId=${usj.periodicalId }">${usj.name }</a>&nbsp;&nbsp; --%>
									<a href="subscribeB/findNewPerPeriodical?periodical.periodicalId=${usj.periodicalId }">${usj.name }</a>&nbsp;
									<input type="hidden" class="state" value="${usj.state }">
									<input type="hidden" class="id" value="${usj.periodicalId }">
									<span class="stateValue">
										<!-- 在此添加一个隐藏域-->
										<%-- perPeriodical/perPeriodicalId?perPeriodical.perPeriodicalId=${ perPeriodicals.perPeriodicalId } --%>
										<%-- <c:if test="${usj.state == 0 }">订阅</c:if>
										<c:if test="${usj.state == 1}">已订阅</c:if>
										${usj.state } --%>
									</span>
								</div><!----------期刊名---->
							</div>
							</c:forEach>	
						<jsp:include page="/page2.jsp" />
						</div>
				</div>
			</div>
		</div>
	</div>
</div>
<jsp:include page="footer.jsp"></jsp:include>
</body>
</html>
